Skip to content

Read result tables and points with one RFC 4180 CSV reader; check outputs and choices of cached schemas - #40

Merged
guijacquemet merged 2 commits into
mainfrom
claude/qupath-issues-17-20
Oct 16, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/qupath-issues-17-20

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Issue 17 (CSV with quoted line breaks)

Fixes #17

Root cause on current main: result tables already read quoted multi-line cells (QP-11, readCsv), but points (placePoints) still used readLines + a one-line splitCsv, so a record with a quoted line break became several "points" (wrong coordinates, or an exception). There was also no validation of the x/y columns and no sentence for a malformed file.

Fix: new LcCsv.groovy (listed in parts.txt, 85 lines) is the one reader for tables and points. It handles quoted commas, doubled quotes, line breaks inside cells, CRLF, a missing last newline, a leading BOM and UTF-8. LcCsv.points checks the y/x columns, the cell count of each record and that each coordinate is a finite number. Malformed input (unclosed quote, text after a closing quote, stray quote) raises LcCsvError with the record and line. The results window shows that as "Not placed on an image: ..." for points and "table 'x' cannot be shown: ..." for tables. readCsv and splitCsv are removed.

Tests:

  • tests/gui_test_parity_results_body.groovy: 14 new checks on the reader, points validation and a malformed table.
  • tests/gui_test_adversarial_body.groovy with the Spots tool of tests/adversarial_app gaining a note parameter: a real Toolkit run whose metadata cell holds a line break, comma, quotes and non-ASCII text must give one annotation with 3 points at the expected coordinates and 3 table rows with the full text.

Issue 20 (registry and cached manifest validation)

Refs #20. Most of what the issue lists is already on main (QP-1, LcRegistry.entryProblem, schemaProblem, fileReason, untrustedReason): types of name/module/python/prefix/pythonpath/runtime_path, schema.tools must be a list, tool ids and parameter identifiers, the cached schema's owner and group/other-write bits, the schema next to the entry, interpreter, folder and prefix permissions, and per-app skip reasons. README.md already states that owner/mode checks do not apply on Windows. schema.tools: null and an input without a name are refused today with a reason.

What was still missing, now added (the Fiji script's choice rule plus the output shape the results window reads): a choice parameter with no choices, and an output that is not an object with a plain name and a text type, are refused at discovery. A parameter of an unknown type stays a per-tool refusal in the form ("this tool cannot be shown"), the same as the Napari and Fiji hosts, by design, so one new type does not hide the other tools of an app.

Tests: 19 new fixtures in tests/gui_test_parity_trust_body.groovy (null / non-list tools, non-object tool, input and output, missing or non-text names, choice without choices, output with path-like name, non-text pythonpath item, runtime_path and module) plus one valid app with a choice and outputs that must still load.

Checks run locally

  • groovy-lint (npm-groovy-lint 18.0.0, the CI command, on the joined parts): 0 findings. Part files are below 600 lines.
  • The new CSV checks run in plain Groovy against LcCsv (13/13 pass).
  • The GUI bodies run in the qupath-gui workflow of this PR (green).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN


Generated by Claude Code


Generated by Claude Code

…puts and choices of cached schemas

Issue 17: a points record with a quoted line break was split by readLines/splitCsv into several points.
New LcCsv reads records (quoted commas, doubled quotes, line breaks, CRLF, BOM) for tables and points, validates the x/y columns and coordinates,
and reports a malformed file as one sentence instead of misplaced annotations.
Issue 20: most of the requested registry/schema validation was already in main (QP-1); the schema check now also refuses a choice parameter
without choices and an output without a plain name and text type.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
…ield is one line)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
@guijacquemet
guijacquemet merged commit d77ab27 into main Oct 16, 2026
2 checks passed
@guijacquemet
guijacquemet deleted the claude/qupath-issues-17-20 branch October 16, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse quoted multiline CSV records correctly in QuPath tables and point annotations

2 participants